#pragma GCC optimize(2)
#include <iostream>
#include <algorithm>
#include <cstring>
#include <string>
#include <map>
#include <unordered_map>
#include <vector>
#include <set>
#include <queue>

using namespace std;
using LL = long long;
using PII = pair<int, int>;

int n, m;
string s;

int main(){
    freopen("in.txt", "r", stdin);
    freopen("out.txt", "w", stdout);
    ios::sync_with_stdio(false);
    cin.tie(nullptr);

    cin >> n >> m;
    int res = 0;
    for(int i = 1; i <= n; i ++){
        cin >> s;
        for(int j = 0; j < m; j ++){
            if(s[j] == '#') res ++;
        }
    }

    cout << res;



    return 0;
}